package com.example.myproject.repository;

import com.example.myproject.model.Contract;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface ContractRepository extends JpaRepository<Contract, Long> {
    Contract findByName(String name);

    void deleteByName(String name);

    List<Contract> findBynameContaining(String name);

    List<Contract> findByStatus(int status);

    // 根据合同名称和状态进行模糊查询
    List<Contract> findByNameContainingAndStatus(String name, int status);


    Optional<Contract> findById(Long userIds);


    // 新增的查询方法
    List<Contract> findByIdIn(List<Long> ids);

}
